<template>
	<section v-if="info.cmmdtyInfoItems&&info.cmmdtyInfoItems.length">
		
		<div class="send-main">
            <div class="send-address" @click.stop = "routerAddress">
              <div class="person"><b class="dingwei"></b>
			  	<template v-if="info.deliveryInfo && defaultAddress.addressId">
					<h5 style="color:#444;font-size:.56rem">
						{{userInfo.userName || info.deliveryInfo.receiverName}}/{{(userInfo.phone || info.deliveryInfo.receiverMobile) | phoneCoded}}
					</h5>
					<h5 style="color:#999;font-size:.48rem;margin-left: 1.2rem;">
						{{userInfo.provName ||info.deliveryInfo.provinceName}}{{userInfo.cityName ||info.deliveryInfo.cityName}}{{userInfo.distName ||info.deliveryInfo.districtName}}{{userInfo.townName}}{{userInfo.poiName ||info.deliveryInfo.interestPointName}}{{userInfo.pathName ||info.deliveryInfo.detailAddress}}{{userInfo.houseNumber}}
						<!--江苏南京市玄武区全区苏宁易购总部一街区 一栋 一单元 1111室   12312-->
					</h5>
				</template>
				<h5 v-else style="color:#999;font-size:.48rem;margin-left: 1.2rem;">
					请选择地址
				</h5>
				<i></i>
              </div>
            </div>
			<!--商品列表-->
			<router-link to="/cart2/shopDetail">
				<ul class="cart2-list">
					<li v-for="item in info.cmmdtyInfoItems" v-if="info.cmmdtyInfoItems.length==1">
						<div class="cart2-list-img">
							<img :src="item.mainCmmdtyHeadInfo.cmmdtyCode | newImgUrl(item.mainCmmdtyHeadInfo.imgFlag)" alt="" @error.once="imgError">
						</div>
						<div class="cart2-list-right">
							<p class="">{{item.mainCmmdtyHeadInfo.cmmdtyName}} </p>
							<div>
								<em>&yen;{{item.mainCmmdtyHeadInfo.salesPrice | formatPrice}} <b></b></em>
								<span class="num">&times; {{item.mainCmmdtyHeadInfo.cmmdtyQty}}</span>
							</div>
						</div>
					</li>
					<li>
						<div class="cart2-list-img" v-for="(item, key) in info.cmmdtyInfoItems" v-if="info.cmmdtyInfoItems.length > 1&&key<3">
							<img :src="item.mainCmmdtyHeadInfo.cmmdtyCode | newImgUrl(item.mainCmmdtyHeadInfo.imgFlag)" alt="" @error.once="imgError">
							<span v-if="parseInt(item.mainCmmdtyHeadInfo.cmmdtyQty)>1" v-text="item.mainCmmdtyHeadInfo.cmmdtyQty+'件'"></span>
						</div>
						<div class="detail-link" v-if="info.cmmdtyInfoItems.length > 1">
							<span v-if="info.cmmdtyInfoItems.length>3">
								<em></em>
								<em></em>
								<em></em>
							</span>
							共{{cartNumber}}件
							<i></i>
						</div>
					</li>
				</ul> 
			</router-link>
            <div style="position:relative" class="send-time">
				<!--自提-->
              	<p v-if="addressInfo.cartHeadInfo.canPickUp==1&&isPinkUp&&shopType=='0'" style="position: relative;" class="clock-bg">
				  <span>苏鲜生自提</span>
				  <em style="float: right;">
                  	<input type="checkbox" class="weui-switch" v-model="checkedPick" @change="deliveryChange">
				  </em>
				</p>
				<template v-if="checkedPick">
					<p class="clock-bg">自提地址 <em class="fr">{{addressInfo.cartHeadInfo.pickUpAddress}}</em></p>
					<p class="clock-bg">门店电话 <em class="fr">{{addressInfo.cartHeadInfo.pickUpTel}}</em></p>
					<p class="clock-bg">服务时间 <em class="fr">{{addressInfo.cartHeadInfo.pickUpTime}}</em></p>
					<p class="clock-bg">商品自提</p>
				</template>
				<p v-else class="clock-bg">由{{ whoDelivery }}</p>
				<template v-if="showArrivalTime">
					<router-link to="/cart2/shopDetail">
					<p class="clock-bg arrivalTime">
						<span v-if="shopType=='1'">苏宁配送</span>
						预计送达时间 
						<em>{{showArrivalTime}}</em>
					</p>
					</router-link>
				</template>			

              	<!--<popup-picker class="delivery-time" title="预计送达时间" :data="info.deliveryList" :columns="1" v-model="deliveryValue" ref="picker3"><i></i></popup-picker>-->
				<p class="clock-bg" style="margin-top: .4rem;">支付方式 <em style="float: right;margin-right: .2rem;color:#444">苏宁支付</em></p>
				<a :href="'#/cart2centerconpon/'"><p class="clock-bg J-toquanpage">优惠券<em style="float: right;margin-right: .2rem;" class="curtimegrey" v-html="centerAllinfo.length > 0?centervolumeinfo: volumeInfo"></em></p></a>
				<p class="clock-bg">发票信息
 
					<router-link :to="'/cart2/invoice/'+info.cartHeadBasicInfo.cart2No" exact>
						<span style="float: right;margin-right: .2rem;color:#444">{{ invoiceName(info.invoiceInfo.invoiceType) }}-{{ info.invoiceInfo.invoiceTitle }}</span>
					</router-link>
					<i></i>
				</p>
              <!--<p class="clock-bg sp-height">备注:
                <textarea v-bind:placeholder="info.cartHeadBasicInfo.commentTips" maxlength="30" id="memojson"></textarea>
              </p>-->
            </div>
            <div class="buy-list">
				<p class="gift"><span class="good-name">商品总额</span><span style="width:auto;color:#ff782d" class="num">&yen; {{info.cartHeadBasicInfo.totalAmount | formatPrice}}</span></p>
				<p style="position:relative" class="gift">
					<span class="good-name">运费</span>
					<!--<em class="ask-mask" @click="deliveryPrice">?</em>-->
					<span style="width:auto;color:#ff782d" class="num">&yen; {{info.cartHeadBasicInfo.transportFee | formatPrice}}</span>
				</p>
				<p class="gift"><span class="good-name">优惠</span><span style="width:auto;color:#ff782d" class="num">- &yen; {{info.cartHeadBasicInfo.voucherTotalAmount | formatPrice}}</span></p>
            </div>

        </div>
		<div class="xiadan">
			  	<em>
					实付金额：<strong>&yen;{{info.cartHeadBasicInfo.payAmount | formatPrice}}</strong>
				</em>
				<!--<p>(
					<span v-if="parseFloat(info.cartHeadBasicInfo.voucherTotalAmount)>0">已优惠 &yen;{{info.cartHeadBasicInfo.voucherTotalAmount | formatPrice}}</span>
					<span v-if="parseFloat(info.cartHeadBasicInfo.transportFee)>0">含运费 &yen;{{info.cartHeadBasicInfo.transportFee | formatPrice}}</span>
					<span v-else>免运费</span>
					)
				</p>-->
            	<button @click="centerGoPay(cart2No)">立即下单</button>
        </div>

	</section>
</template>

<script>
	import fetch from '@/config/fetch'
	import * as env from '@/config/env'
	import router from '@/router/index'
	import {getCookie} from '@/config/utils'
  	import { Cart2centercoupon } from '@/service/getData'

	import { PopupPicker, TransferDomDirective as TransferDom } from 'vux'
	import { mapGetters, mapActions } from 'vuex'
	import '../../style/weui-switch.scss'

	export default {
		name: 'cart',
		directives: {
			TransferDom
		},
		data(){
			return {
				info:{},
				addressInfo:{
					cartHeadInfo:{
						canPickUp: 0
					}
				},
				show: false,
				tebshow: 0,
				deliveryValue: ['一小时急速达'],
				checkedPick: false,
				deliveryType:'',
				cart2No: this.$route.params.cart2No,
				volumeInfo:'',
			}
		},
		components: {  
			PopupPicker,
		},
		created (){
			this.getCenterCart2()
			this.$store.commit('showMask', true)
		},
		methods: {
			...mapActions([
				'centerGoPay'
			])

			,invoiceName(type){
				let invoiceType = {
					'00': '无发票',
					'01': '增值税发票',
					'02': '普通发票',
					'03': '纸质电子发票',
					'04': '电子发票',
					'05': '不开发票'
				}
				return invoiceType[type]
				
			}
			// 获取小店中心仓车2展示信息
			,getCenterCart2 (num) {
				let customerNo = getCookie('custno')
				let params = {
					cart2No: this.$route.params.cart2No,
					customerNo: customerNo,
					operationTerminal: '06'
				}
				fetch({
					url: env.shop + '/xd-cart-web/cloud/cart2/showCartInfo.do',
					params: params
				}).then((info) => {
					this.$store.commit('showMask', false)
					// 容错处理待优化
					if(info.code==1&&info.data.cmmdtyInfoItems.length){
						console.log(info.data.cmmdtyInfoItems)
						//成功
						this.info = info.data
						// 判断配送类型01 配送 02 自提
						//debugger
						this.$store.commit('centerCart2Info', info.data)
						if(!this.deliveryType){
							this.deliveryType = info.data.deliveryInfo.deliveryType
							this.setAddress ()
						}


						if(num == 1 && info.data) {
							 this.Cart2centercouponFn(info.data)
						}



					} else if (info.data.errorInfos && info.data.errorInfos.length) {
						// router.push('/snOrderList')
						let err = info.data.errorInfos[0];
						// 易付宝返回来时
						if (err.errorCode == 'CSC-10-0003') {
							AlertBox({
								type: "onceConfirm",
								alertType: "fixed",
								msg: "您的订单已提交成功，如果暂不支付，可去订单中心再次支付！",
								confirmText: '确定',
								confirm: function(){
									router.push('/snOrderList');
								}
							});
						}
						else {
							AlertBox({type: "mini", msg: err.errorMessage});
						}
					}
				});
			},
			//获取优惠券
			Cart2centercouponFn(data){
				// console.log(data.discountInfos[0].discountDetailInfo,1111)
				var arr = [];
				for(var i = 0; i < data.cmmdtyInfoItems.length; i++) {
					var ch = data.cmmdtyInfoItems[i].cmmdtyHeadInfo;
					var mch = data.cmmdtyInfoItems[i].mainCmmdtyHeadInfo;

					arr.push({
		                "productHeader":{
		                    "subActivityType": ch.subActivityType || '',
		                    "activityType":ch.activityType || '',
		                    "activityId":ch.activityId || '',
		                    "itemNo": ch.itemNo || ''
		                },
		                "mainProduct":{
		                    "salesAmount":mch.salesAmount || '',
		                    "shopCode": mch.shopCode || '',
		                    "cmmdtyCode": mch.cmmdtyCode || '',
		                    "overSeasFlag": mch.overSeasFlag || '',
		                    "listPrice": mch.salesPrice || '',
		                    "locatCode": mch.locatCode || '',
		                    "itemNo": mch.itemNo || '',
		                    "cmmdtyQty":mch.cmmdtyQty || '',
		                    "serviceType": mch.serviceType || '',
		                    "serviceFlag":mch.serviceFlag || '',
		                    "saleOrg":  mch.saleOrg || '',
		                    "salesPrice": mch.salesPrice || '',
		                    "supplierCode": mch.supplierCode || ''
		                  },
		                "subProductList":[],
		                "warrantyList":[]
		              })
				}

				var siarr = [];
				for(var i = 0; i < data.shopInfos.length; i++) {
					var si = data.shopInfos[i]
					siarr.push({
			              "shopCode": si.shopCode? si.shopCode: '',
			              "shopDeliveryFee": +si.shopDeliveryFee? si.shopDeliveryFee+'0000': si.shopDeliveryFee
			            })
				}
				Cart2centercoupon({
					  cart2No: data.cartHeadBasicInfo && data.cartHeadBasicInfo.cart2No,
		              cityCode: data.deliveryInfo && data.deliveryInfo.cityCode,
		              customerNo: data.cartHeadBasicInfo && data.cartHeadBasicInfo.customerNo,
		              deliveryMode: data.deliveryInfo &&  data.deliveryInfo.deliveryType && data.deliveryInfo.deliveryType[1],
		              discountInfos: JSON.stringify([{
		                "discountDetailInfo":data.discountInfos[0] && data.discountInfos[0].discountDetailInfo,
		                "cmmdtyLineInfoList":data.discountInfos[0] && data.discountInfos[0].cmmdtyLineInfos[0]
		              }]),
		              operationTerminal: '06',
		              orderType: '0',
		              payment: '01',
		              productList: JSON.stringify(arr),
		             shopInfos:JSON.stringify(siarr)

		          })
		          .then((rep) => {
		          	console.log(rep,111)
		          	var data1 = rep.data;

		          		if(!data1)return;
		          		var cl = data1.couponList;
		          		if(toString.call(cl) == '[object Array]'){
		          			cl.push(this.$route.params.cart2No)
		          		}else {
		          			return
		          		}
		          		sessionStorage.cl = JSON.stringify(cl);
		          		// this.couponList = JSON.stringify(cl)
		          		var ableNum = 0;
		          		if(cl) {
		          			for(var i = 0; i < cl.length; i++ ){
			          			if(cl[i].usefulFlag == '1') {
			          				ableNum ++
			          			}
			          		}
			          }

			          this.volumeInfo = ableNum? `<span class="enable_volume">${ableNum}张优惠券可用</span>`: '没有优惠券可用'
		          })

			}
			// 设置默认收货地址
			,setAddress () {
				/**
				 * 判断state中是否有默认地址，没有则取当前poiId下面的地址
				 * 
				 */
				let self = this
				let cart2No = this.$route.params.cart2No;
				let recDelivery = function(addressId){
					let	deliveryType = self.deliveryType
					probeAuthStatus(cusNo => {
						fetch({
							url: env.shop + '/xd-cart-web/cloud/cart2/recDelivery.do',
							params: 
							{
								addrNum: addressId.toString(),
								cart2No: cart2No,
								customerNo: cusNo,
								deliveryType: deliveryType,
								operationChannel: 50
							},
							type: 'post'
						}).then(res => {
							self.getCenterCart2(1)
							if(res.code==1){
								self.addressInfo = res.data
							}else{
								AlertBox ({type: 'mini', msg: res.msg})
							}
						})
					})
				}
				if(this.$store.state.defaultAddress.addressId){
					recDelivery(this.$store.state.defaultAddress.addressId)
				}else{
					fetch({
						url: `${env.mdm}/cmwsmdm-web/address/getAddressByPoi.do?poiId=${this.$store.state.position.poiId}`,
						params: {}
					}).then(res => {
						if ( res.code !='1'|| !res.data.userAddressInfo ){

							this.getCenterCart2 (1)
							return
						}
						let info = res.data.userAddressInfo;
						recDelivery(info.addressId)
						this.$store.commit('setDefaultAddress', {addressId: info.addressId})
					})
				}
			}

			,deliveryChange(){
				this.deliveryType = this.checkedPick?'02':'01'
				this.setAddress()
			}

			// 获取发票信息
			,invoiceInfo () {
				let params = {
					app: 'wap',
					appVersion: '3.2.2',
					cityId: rootState.position.cityCode,
					operationStoreCode: rootState.position.storeLocation,
					poiId: rootState.position.poiId
				}
				fetch({
					url: tps + '/app/cart2/private/showCartInfo.do',
					params: params,
					jsonp: 'callBack'
				}).then((info) => {
					console.log(info)
					if(info.code==1){
						
						commit('updateCart2', info.data)
						//跳转
					}else if(info.code=='SYS-20-01-0000'){
						router.push('/order')
					}else{
						AlertBox ({type: 'mini',msg: json.msg})
					}
				});
			}
			
			// 去支付
			,goPay(){
				this.$store.commit('showMask', true)
				let params = {
					cart2No: this.$route.params.cart2No,
					deviceNo: 'wap'
				}
				fetch({
					url: env.shop + '/xd-cart-web/cloud/cart2/submitOrder.do',
					params: params,
					type: 'post'
				}).then((info) => {
					console.log(info)
					if(info.code==1){
						if(info.data.cartHeadInfo.isSuccess=='N'){
							AlertBox ({type: 'mini',msg: info.data.errorInfos[0].errorMessage})
						}

						let orderId = info.data.orderItems[0].orderInfo.orderId;

						// 调用OFS接口跳转到支付中台
						var postUrl = env.order + '/wap/pay/toPay.do';
						var ExportForm = document.createElement("FORM");  
						document.body.appendChild(ExportForm);  
						ExportForm.method = "GET";

						var inputData = [{
								name: 'orderId',
								value: orderId
							},{
								name: 'deviceInfo',
								value: ''
							},{
								name: 'payFlag',
								value: '1'
							},{
								name: 'wapCustomUrl',
								value: `${location.origin}/#/cart4/center/${this.$route.params.cart2No}`
							}]

						for(let i =0; i<inputData.length; i++){
							var newElement = document.createElement("input");  
							newElement.value = inputData[i].value;
							newElement.setAttribute("name", inputData[i].name);  
							newElement.setAttribute("type", "hidden");
							ExportForm.appendChild(newElement);   
						}
						
						ExportForm.action = postUrl;
						ExportForm.submit();  

					}else if(info.code=='SYS-20-01-0000'){
						router.push('/order')
					}else{
						AlertBox ({type: 'mini',msg: info.msg})
					}
				}).then((info) => {

					
				});
			}

			,routerAddress () {
				this.$router.push(`/cartAddress?cartLink=/cart2/center/${this.$route.params.cart2No}`)
			}
			// 根据后台日期格式 返回显示的日期 返回 ['2017','05','28']
			,getFormatData(data){
				var ab = data.split('-')
				let TIMEARRAY ={
					"1":"09:00-18:00",
					"2":"09:00-14:00",
					"3":"14:00-18:00",
					"4":"18:00-23:00"
				}
				var db = new Date();
				db.setFullYear(ab[0], ab[1]-1, ab[2]);
				var unixDb=db.getTime();
				var weeks = new Date(parseInt(unixDb)).getDay();
				var weeksTxt = ['周日','周一','周二','周三','周四','周五','周六'][weeks]

				return `${ab[0]}-${ab[1]}-${ab[2]} [${weeksTxt}] ${TIMEARRAY[ab[3]]}`
			},

			imgError(event) {
				event.target.src = '/static/images/pro-default.png';
			},
		},
		computed: {
			...mapGetters([
				'defaultAddress','position','userInfo','centervolumeinfo'
			]),
			showmask(){
				return this.$store.state.showMask
			},
			 
			centerAllinfo(){
				return this.$store.state.cart2.centervolumeinfo
			} 

			// 判断所有商品是否支持自提
			,isPinkUp(){
				let info = this.info
				if(info){
					let infoItems = info.cmmdtyInfoItems
					return infoItems.every(x=>x.availDeliveryTypes.length>=2)
				}
				return false
			}

			/*判断商品组合情况
			*0:只有自营
			*1:自营+c店
			*2:只有c店
			*/
			,shopType(){
				let info = this.info
				if(info){
					if(info.shopInfos.every(x=>x.shopCode == '0000000000')){
						return '0'
					}else if(info.shopInfos.every(x=>x.shopCode != '0000000000')){
						return '2'
					}else{
						return '1'
					}
				}
			}

			// 判断由谁配送
			,whoDelivery(){
				if(this.shopType=='0'){
					return '苏宁配送'
				}else if(this.shopType=='2'){
					return '商家配送'
				}else{
					return '苏宁配送+商家配送'
				}
			}

			// 判断自营商品配送时间是否相同，相同则返回时间
			,showArrivalTime(){
				let info = this.info
				if(info){
					let selfShop = info.cmmdtyInfoItems.filter(x => x.mainCmmdtyHeadInfo.shopCode=='0000000000')
					if(!selfShop.length) return
					let oneTime = selfShop[0].mainCmmdtyHeadInfo.selectedArrivalTime
					info.cmmdtyInfoItems.forEach(item=>{
						if(item.mainCmmdtyHeadInfo.shopCode=='0000000000'){
							if(item.mainCmmdtyHeadInfo.selectedArrivalTime != oneTime){
								return false
							}
						}
					})
					
					return this.getFormatData(oneTime)
					
				}else{
					return false
				}
			},

			cartNumber(){
				let num = 0;
				this.info.cmmdtyInfoItems.forEach(item => {
					num += item.mainCmmdtyHeadInfo.cmmdtyQty
				})
				return num
			}
		}
		,updated (){
			this.$store.commit('showMask', false)
		}
		,watch: {
			deliveryType: function (val, oldVal) {
				// this.checkedPick = val=='02'?true:false
			}
		}
	}
</script>
<style>
 .curtimegrey span{
		color: rgb(255, 120, 45);
}
 .curtimegrey span.enable_volume {
	color: #fff;
	background-color: #7ed320;
}
</style>
<style lang="scss" scoped>

	@function _($px) {
		$rem: $px/50;
		@return #{$rem}rem;
	}

	.send-main {
		width: 15rem;
		overflow-x: hidden;
		-webkit-overflow-scrolling: touch;
		height: 100%;
		padding-bottom: 1.96rem;
		box-sizing: border-box;
	}
	.send-address,.send-time,.buy-list {
		position: relative;
		margin: .4rem 0;
	}

	.send-address div,.send-time div,.buy-list div,.send-address p,.send-time p,.buy-list p {
		position: relative;
		padding: 0 .8rem;
		box-sizing: border-box;
		height: 1.76rem;
		line-height: 1.76rem;
		background: #fff;
		background-size: .56rem;
		margin-bottom: .04rem;
		color: #444;
		font-size: .56rem
	}

	.send-address .person,.send-time .person,.buy-list .person {
		min-height: 2.4rem;
		height: auto;
		line-height: .76rem;
		background-image: none;
		padding-left: .8rem;
		padding-top: .44rem;
		box-sizing: border-box;
		font-size: _(24)
	}

	.xiadan {
		position: fixed;
		left: 0;
		bottom: 0;
		right: 0;
		border-top: 1px solid #e8e8e8;
		background-color: #fff;
		color: #fff;
		font-size: .72rem;
		text-align: center;
		height: 1.96rem;
		line-height: 1.96rem;
		width: 15rem;
		margin: 0;
		border-radius: 0;
		z-index: 2;
		em{
			position: absolute;
			text-align: right;
			top: 50%;
			left: 1rem;
			height: .72rem;
			line-height: .72rem;
			color: #333;
			font-size: _(26);
			margin-top: -.36rem;
			strong{
				height: .72rem;
				display: inline;
				float: right;
				color: #ff782d;
				font-weight: normal;
				font-size:_(34);
			}
		}
		p{
			position: absolute;
			right: 4.2rem;
			top: .4rem;
			color: #999;
			height: .72rem;
			text-align: right;
			font-size: _(24)
		}
		button{
			width:4rem;
			float:right;
			height:100%;
			margin:0;
			background:#ff782d;
			color:#fff;
			border:none;
			border-radius:0;
			font-weight:400
		}
	}
	.good-name {
		display: inline-block;
		height: 1.76rem;
		overflow: hidden;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: block-axis;
		float: left;
		text-overflow: ellipsis;
	}
	.ask-mask {
		display: inline-block;
		color: #5ecd00 !important;
		left: 2.5rem;
		border-radius: 50%;
		border: 1px solid #5ecd00;
		line-height: 1.2;
		width: .6rem;
		height: .6rem;
		top: 0;
		bottom: 0;
		margin: auto 0;
		margin-left: .2rem;
		box-sizing: border-box;
		text-align: center;
	}
	.send-time .sp-height {
		height: 2.52rem;
		background-position-y: .52rem;
	}
	.send-time textarea {
		float: right;
		height: 2rem;
		width: 10.96rem;
		border: none;
		margin-top: .52rem;
		outline: none;
		resize: none;
	}
	
	.gift .num {
		float: right;
		line-height: 1.76rem;
	}
	.buy-list .goods-list{
		background-color: #f9f9f9;
		.good-name{
			width: 9rem;
		}
	}
	.dingwei {
		float: left;
		width: .88rem;
		height: .88rem;
		background-image: url();
		margin-left: -.2rem;
		margin-right: .56rem;
		background-size: contain;
	}
	.send-main i {
		position: absolute;
		top: 50%;
		right: 0;
		-webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
		transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
		border-width: 1px 1px 0 0;
		border-color: #C8C8CD;
		border-style: solid;
		margin-top: _(-9);
		height: _(18);
		width:  _(18);
		background-size: contain;
		margin-right: .4rem;
	}
	.send-time span{
		display: inline-block;
	}
	.send-time .arrivalTime{
		height: auto;
		background-color: #f5f5f5;
		span{
			display: block;
			height: .8rem;
		}
		em{
			float: right;
			margin-right: .2rem;
			color:#ff782d
		}
	}
	.clock-bg{
		.fr{
			width: 10rem;
			max-height: 1.76rem;
			overflow: hidden;
			white-space: nowrap;
			text-overflow: ellipsis;
			text-align: right;
			float: right;
			margin-right: .2rem;
			color:#333
		}
	}
	.curtimegrey {
		color: #999 !important;
	}

	.cart2-list{
		position: relative;
		background-color: #fff;
	    padding: .4rem 0;
        margin-bottom: -0.4rem;
        border-bottom: #e3e3e3 1px solid;
		.detail-link{
			position: absolute;
			top: 50%;
			right: _(10);
			transform: translateY(-50%);
			font-size:_(26);
			padding-right: _(40);
			text-align: right;
			span{
				width: _(50);
				margin-right: .2rem;
				vertical-align: 3px;
				em{
					display: inline-block;
					width: _(8);
					height: _(8);
					background:#d8d8d8;
					border-radius: 100%;
				}
			}
		}
	}
	.cart2-list li{
		//overflow: hidden;
	}
	.cart2-list-img {
		margin-left: 0.8rem;
		width: 2.38rem;
		height: 2.38rem;
		border: #d5d5d5 solid 1px;
		display: inline-block;
		box-sizing: content-box;
		position: relative;
		img{
			display: inline-block;
			width: 2.38rem;
			height: 2.38rem;
		}

		span {
			position: absolute;
			right: 0;
			bottom: 0;
			line-height: 1em;
			padding: 0 0.1rem;
			background-color: rgba(0, 0, 0, 0.5);
			color: #fff
		}
	}
	.cart2-list-right {
		width: 11.2rem;
		padding-left: 0.5rem;
		display: inline-block;
		vertical-align: middle;
		height: 2rem;
		line-height: 0.6rem;
		position: relative;

		 & > p {
		 	width: 90%;
			position: absolute;
			top: 0;
			left: 0.5rem;
		 }
		 & > div {
		 	width: 90%;
			position: absolute;
			bottom: 0;
			left: 0.5rem;

			em {
				float: left;
			}
			span {
				float: right;
			} 
		 }
	}

</style>
<style lang="scss">
	.delivery-time{
		.weui-cell{
			padding:0;
			display: block;
		}
		.weui-cell__hd{
			float: left;
		}
		&:before{
			display: none;
		}
		.weui-cell_access .weui-cell__ft{

		}
		.weui-cell_access .weui-cell__ft:after{
			position: absolute;
			right: -0.36rem;

			height: 0.36rem;
			width:  0.36rem;
			border-width:1px 1px 0 0;
			margin-top: .7rem;
		}
		.vux-popup-picker-select span{
			padding-right: 0
		}
		.vux-cell-primary{
			float: right;
			flex: inherit;
			margin-right: 0.2rem;
		}
		
	}
	// .vux-popup-dialog{
	// 	width: 10rem;
	// }

	.weui-dialog__ft{
		//display: block!important
	}
	
	.weui-dialog__bd{
		min-height: 0;
	}

</style>

